package day_2022_12_to_3.year2023;

/**
 * @author haomin
 * @date 2023/03/24 21:33
 **/
public class Day3_24_Num1032 {
    class StreamChecker {

        String[] str = null;
        StringBuilder sb = null;

        public StreamChecker(String[] words) {
            this.str = words;
            this.sb = new StringBuilder();
        }

        public boolean query(char letter) {
            this.sb = this.sb.append(letter);
            String curString = sb.toString();
            for (String temp : str)
                if (curString.endsWith(temp)) return true;
            return false;
        }
    }
}